package com.ruoyi.system.config;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

public class ApiClient {
    private static ApiClient instance;
    private String baseUrl;

    private ApiClient(String configPath) {
        Properties properties = new Properties();
        try (InputStream input = new FileInputStream(configPath)) {
            properties.load(input);
            this.baseUrl = properties.getProperty("baseUrl");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static ApiClient getInstance(String configPath) {
        if (instance == null) {
            instance = new ApiClient(configPath);
        }
        return instance;
    }

    public String getBaseUrl() {
        return baseUrl;
    }
}

